From: Nimish Gautam Date: Wed, 13 Apr 2011 23:47:01 +0000 (+0000) Subject: Created BeforeWelcomeCreation hook to be run before any welcome message gets displayed X-Git-Tag: 1.31.0-rc.0~30860 X-Git-Url: http://git.cyclocoop.org/%22.%24match%5B1%5D.%22?a=commitdiff_plain;h=b971a366a0cf89c94274f207627eaee769f91b4e;p=lhc%2Fweb%2Fwiklou.git Created BeforeWelcomeCreation hook to be run before any welcome message gets displayed --- diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 348ee57959..e23e28d61a 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -904,9 +904,14 @@ class LoginForm extends SpecialPage { global $wgUser; # Run any hooks; display injected HTML $injected_html = ''; + $welcome_creation_msg = 'welcomecreation'; + wfRunHooks( 'UserLoginComplete', array( &$wgUser, &$injected_html ) ); - - $this->displaySuccessfulLogin( 'welcomecreation', $injected_html ); + + //let any extensions change what message is shown + wfRunHooks( 'BeforeWelcomeCreation', array( &$welcome_creation_msg, &$injected_html ) ); + + $this->displaySuccessfulLogin( $welcome_creation_msg, $injected_html ); } /** @@ -916,7 +921,10 @@ class LoginForm extends SpecialPage { global $wgOut, $wgUser; $wgOut->setPageTitle( wfMsg( 'loginsuccesstitle' ) ); - $wgOut->addWikiMsg( $msgname, $wgUser->getName() ); + if( $msgname ){ + $wgOut->addWikiMsg( $msgname, $wgUser->getName() ); + } + $wgOut->addHTML( $injected_html ); if ( !empty( $this->mReturnTo ) ) {